#ifndef __G_SHADER_H__
#define __G_SHADER_H__

#include "IResource.h"
#include "ShaderHelper.h"

//class Shader : public IResource
//{
//protected:
//	FWint m_vertexShader;
//	FWint m_fragmentShader;
//public:
//	//Shader program object
//	FWint ProgramObject;
//
//	//Vertex local position (attribute a_PosL)
//	FWint Position;
//	//Vertex corlor (attribute a_ColorL)
//	FWint Color;
//	//Vertex local coordinate (uv) (attribute a_UV)
//	FWint Coordinate;
//	//Vertex local normal (attribute a_Normal)
//	FWint Normal;
//	//Vertex local binormal (attribute a_BiNormal)
//	FWint BiNormal;
//	//Vertex local Tangent (attribute a_TGT)
//	FWint Tangent;
//
//	//Vertex local world matrix (uniform u_MatrixL)
//	FWint MatrixLocal;
//	//World-View-Projection matrix (uniform u_MatrixWVP)
//	FWint MatrixWVP;
//
//	//Cube texture (sampler s_SamplerCube)
//	FWint CubeSampler;
//	//Orther texture (sampler)
//	//0-6: Orther texture (sampler s_SamplerX)
//	//7: Normal mapping	(sampler s_SamplerNormal)
//	//8: Lighting mapping (sampler s_SamplerLighting)
//	//9: Shadow mapping (sampler s_SamplerShadow)
//	FWint Samplers[10];
//public:
//	Shader();
//	Shader(FWuint count, char* path, char* names);
//	virtual FWint Init();
//	virtual void Destroy();
//
//	FWuint FindAttribute(const char* name);
//	FWuint FindUniform(const char* name);
//};

class Shader
{
private:
	char* m_filePath;
	char* m_fileVertex;
	char* m_fileFragment;
protected:
	FWint m_vertexShader;
	FWint m_fragmentShader;
public:
	//Shader program object
	FWint ProgramObject;

	//Vertex local position (attribute a_PosL)
	FWint Position;
	//Vertex local coordinate (uv) (attribute a_UV)
	FWint Coordinate;
	//Vertex local normal (attribute a_Normal)
	FWint Normal;
	//Vertex local binormal (attribute a_BiNormal)
	FWint BiNormal;
	//Vertex local Tangent (attribute a_TGT)
	FWint Tangent;

	//Vertex local world matrix (uniform u_MatrixL)
	FWint MatrixLocal;
	//World-View-Projection matrix (uniform u_MatrixWVP)
	FWint MatrixWVP;

	//Cube texture (sampler s_SamplerCube)
	FWint CubeSampler;
	//Orther texture (sampler)
	//0-6: Orther texture (sampler s_SamplerX)
	//7: Normal mapping	(sampler s_SamplerNormal)
	//8: Lighting mapping (sampler s_SamplerLighting)
	//9: Shadow mapping (sampler s_SamplerShadow)
	FWint Samplers[10];
public:
	Shader();
	Shader(char* path, char* vs, char* fs);
	virtual FWint Init();
	virtual void Destroy();

	FWuint FindAttribute(const char* name);
	FWuint FindUniform(const char* name);
};

#endif